package com.ruoyi.ldzlsc.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.ldzlsc.domain.vo.ScTaskVo;
import com.ruoyi.ldzlsc.service.IScTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import com.ruoyi.ldzlsc.service.IScWorkOrderTaskService;

@RestController
@RequestMapping("/sc/task")
public class ScTaskController extends BaseController {

    @Autowired
    private IScTaskService scTaskService;
    @Autowired
    private IScWorkOrderTaskService scWorkOrderTaskService;

    @GetMapping("/list")
    public TableDataInfo list(ScTaskVo query) {
        startPage();
        List<ScTaskVo> list = scTaskService.selectScTaskList(query);
        return getDataTable(list);
    }
    
    /**
     * 获取可报工的任务列表
     */
    @GetMapping("/reportable-list")
    public AjaxResult getReportableList(ScTaskVo query) {
        List<ScTaskVo> list = scWorkOrderTaskService.selectReportableTaskList(query);
        return AjaxResult.success(list);
    }
} 